from day01.basecla import BaseClass
from day01.basecla import driver
from selenium.webdriver.common.by import By
from time import sleep
c=BaseClass()
c.open_browser('file:///E:/%E8%93%AC%E8%8E%B1%E5%B0%8F%E8%AF%BE2024%E6%B5%8B%E8%AF%95/%E7%AC%AC%E5%9B%9B%E9%98%B6%E6%AE%B5/Selenium%E8%87%AA%E5%8A%A8%E5%8C%96/selenium_demo/day05demo/demo04.html')
myname=c.location(By.XPATH,'//input[@id="username"]')
myphone=c.location(By.XPATH,"//input[@id='checkpin']")
mycode=c.location(By.XPATH,'//input[@type="button"]')
myname.send_keys('光小亮')
myphone.send_keys("110110120120")
mycode.click()
sleep(2)
mycode1=driver.switch_to.alert
print(mycode1.text)
mycode1.send_keys('1123')
sleep(2)
mycode1.accept()
mycode.click()
mycode2=driver.switch_to.alert
print(mycode2.text)
mycode2.send_keys('8888')
sleep(2)
mycode2.dismiss()
c.close_browser()
